buffer_ma >> PAGE_SHIFT;
ring_req->frame_and_sects[ring_req->nr_segments++] =
- (((u32) ref) << 16) | (fsect << 3) | lsect;
+ blkif_fas_from_gref(ref, fsect, lsect);
#else
ring_req->frame_and_sects[ring_req->nr_segments++] =
- buffer_ma | (fsect << 3) | lsect;
+ blkif_fas(buffer_ma, fsect, lsect);
#endif
}
}
buffer_ma >> PAGE_SHIFT;
req->frame_and_sects[req->nr_segments] =
- (((u32) ref ) << 16) | (fsect << 3) | lsect;
+ blkif_fas_from_gref(ref, fsect, lsect);
#else
req->frame_and_sects[req->nr_segments] =
- buffer_ma | (fsect << 3) | lsect;
+ blkif_fas(buffer_ma, fsect, lsect);
#endif
if ( ++req->nr_segments < BLKIF_MAX_SEGMENTS_PER_REQUEST )
sg_next_sect += nr_sectors;
blk_shadow[xid].frame[0] = buffer_ma >> PAGE_SHIFT;
- req->frame_and_sects[0] = (((u32) ref)<<16) | (fsect<<3) | lsect;
+ req->frame_and_sects[0] = blkif_fas_from_gref(ref, fsect, lsect);
#else
- req->frame_and_sects[0] = buffer_ma | (fsect<<3) | lsect;
+ req->frame_and_sects[0] = blkif_fas(buffer_ma, fsect, lsect);
#endif
/* Keep a private copy so we can reissue requests when recovering. */
gnttab_grant_foreign_access_ref( ref, rdomid, address >> PAGE_SHIFT, 0 );
- req->frame_and_sects[0] = (((u32) ref) << 16) | 7;
+ req->frame_and_sects[0] = blkif_fas_from_gref(ref, 0, (PAGE_SIZE/512)-1);
blkif_control_send(req, rsp);
}
blkif_control_probe_send(&req, &rsp,
(unsigned long)(virt_to_machine(buf)));
#else
- req.frame_and_sects[0] = virt_to_machine(buf) | 7;
+ req.frame_and_sects[0] = blkif_fas(virt_to_machine(buf), 0, ((PAGE_SIZE/512)-1);
blkif_control_send(&req, &rsp);
#endif
blkif_vdev_t device; /* only for read/write requests */
unsigned long id; /* private guest value, echoed in resp */
blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
- /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect */
+ /* @f_a_s[4:0]=last_sect ; @f_a_s[9:5]=first_sect */
#ifdef CONFIG_XEN_BLKDEV_GRANT
/* @f_a_s[:16]= grant reference (16 bits) */
#else
unsigned long frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
} blkif_request_t;
-#define blkif_first_sect(_fas) (((_fas)>>3)&7)
-#define blkif_last_sect(_fas) ((_fas)&7)
+#define blkif_fas(_addr, _fs, _ls) ((addr)|((_fs)<<5)|(_ls))
+#define blkif_first_sect(_fas) (((_fas)>>5)&31)
+#define blkif_last_sect(_fas) ((_fas)&31)
#ifdef CONFIG_XEN_BLKDEV_GRANT
+#define blkif_fas_from_gref(_gref, _fs, _ls) (((_gref)<<16)|((_fs)<<5)|(_ls))
#define blkif_gref_from_fas(_fas) ((_fas)>>16)
#endif